package com.eax.ControlLayer;
import com.eax.ModelLayer.*;
import java.util.ArrayList;

public class AddressController {
	private AddressBookModel addressBook;

	public AddressController() {
		addressBook = new AddressBookModel();
	}

	public void createPerson(int id, String name, String address, int postalcode, String city, int telephone) {
		addressBook.addPerson(id, name, address, postalcode, city, telephone);
	}

	public PersonModel getPerson(int id) {
		return addressBook.getPersonById(id);
	}

	public void deletePerson(int id) {
		PersonModel temp = addressBook.getPersonById(id);
		addressBook.removePerson(temp);
	}

	public void updatePerson(long id) {
	}

	public ArrayList<PersonModel> listAllPersons() {
		return addressBook.getPeopleList();
	}

	public int getAddressAmount(){
		return addressBook.getSize();
	}

	public int getHighestId(){
		return addressBook.getHighestId();
	}

	public PersonModel findPerson(String input){
		return addressBook.findPerson(input);
	}
}
